<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>注册</title>

    <!--引入资源文件-->
    <link rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/static/css/bootstrap-theme.min.css}">
    <link rel="stylesheet" th:href="@{/static/css/mycss.css}">

    <script th:src="@{/static/js/jquery.min.js}"></script>
    <script th:src="@{/static/js/bootstrap.min.js}"></script>

    <script>
        function check() {

            var warinngdiv = $("#warinnginfo");
            if ($("#exampleInputEmail1").val() == "") {
                warinngdiv.html($("  <div class=\"alert alert-danger signupwarinnginfo\" role=\"alert\"\n" +
                    "                 >账户不能为空</div>"));
                return false;
            }

            if ($("#exampleInputPassword1").val() == "") {
                warinngdiv.html($("  <div class=\"alert alert-danger signupwarinnginfo\" role=\"alert\"\n" +
                    "                 >密码不能为空</div>"));
                return false;
            }

            if ($("#exampleInputPassword1").val() != $("#ensurePassword").val()) {
                warinngdiv.html($("  <div class=\"alert alert-danger signupwarinnginfo\" role=\"alert\"\n" +
                    "                 >两次密码不相同,请重新输入</div>"));
                return false;
            }

            if ($("#userName").val() == "") {
                warinngdiv.html($("  <div class=\"alert alert-danger signupwarinnginfo\" role=\"alert\"\n" +
                    "                 >用户名不能为空</div>"));
                return false;
            }
            return true;
        }
    </script>

</head>
<body class="signupbody">
<div class="signuptitle"> 智慧物流园区</div>

<div class="signup" style="border-radius: 10px ">
    <div style="margin-top:3%;padding: 1px">
        <span style="float: left">
            <a th:href="@{/indexLogin}" style="text-decoration: none;">&lt;返回登录页面</a>
        </span>
        <span style="font-size: 23px;margin-left: 35%">账号注册</span>
    </div>
    <hr style="margin-bottom: 0px">
    <form action="#" th:action="@{/signup}" method="post" class="loginform"
          style="padding-top: 0px" onsubmit="return check()">

        <div class="form-group" style="margin-top: 12%">
            <label for="exampleInputEmail1">账户</label>
            <input type="text" class="form-control" id="exampleInputEmail1" placeholder="输入账户" name="useraccount">
        </div>
        <div class="form-group">
            <label for="exampleInputPassword1">密码</label>
            <input type="password" class="form-control" id="exampleInputPassword1" placeholder="输入密码" name="userpwd">
        </div>

        <div class="form-group">
            <label for="ensurePassword">确认密码</label>
            <input type="password" class="form-control" id="ensurePassword" placeholder="确认密码">
        </div>
        <div class="form-group">
            <label for="userName">用户名</label>
            <input type="text" class="form-control" id="userName" placeholder="用户名" name="name">
        </div>

        <button type="submit" class="btn btn-primary signupbutton">注册</button>

        <div id="warinnginfo" class="form-group"></div>
    </form>

</div>
</body>
</html>